package com.task.core.mapper;


import com.task.core.domain.DataOperationInfo;
import com.task.core.domain.DatasourceInfo;
import com.task.core.domain.info.RelationMissionDataInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DataOperationInfoMapper {


    DataOperationInfo getCanUseSendData(@Param("dataTableName") String dataTableName,
                                        @Param("relationTableName")String relationTableName,
                                        @Param("datasourceInfos") List<DatasourceInfo>  datasourceInfos,
                                        @Param("missionCode")String missionCode,
                                        @Param("affiliateCode")String affiliateCode,
                                        @Param("advertiserCode")String advertiserCode);

    void insertDataToRelationInfo( @Param("relationMissionDataInfo")RelationMissionDataInfo relationMissionDataInfo,@Param("tableName") String tableName);

    DataOperationInfo getCanUseSendRefere(@Param("tabaleName") String tabaleName, @Param("sourceCodes") List<String> sourceCodes);

    void deleteRelationData(@Param("historyCode")String historyCode,@Param("tableName") String tableName);


    void updateRelationData(@Param("historyCode")String historyCode,@Param("tableName") String tableName);



    RelationMissionDataInfo  getDataRelationByDuplicateConditionAndDataSourceAndDataId(
            @Param("missionCode")String missionCode,
            @Param("affiliateCode")String affiliateCode,
            @Param("advertiserCode")String advertiserCode,
            @Param("dataSourceCode")String dataSourceCode,
            @Param("dataCode")String dataCode,
            @Param("dataId")String dataId,
            @Param("tableName")String tableName);

    void updateRelationCode(@Param("relationMissionDataInfo")RelationMissionDataInfo relationMissionDataInfo,
                            @Param("tableName") String tableName);
}
